@extends('layouts.app')
@section('content')
    <div class="container">
        <div class="row">
            <div class="col">

                @include('layouts.errors')
                <h4>{{__('edit-user-info')}}</h4>
                <div class="card">
                    <form class="card-body" action="{{route('users.update',$user->id)}}" method="post"
                    enctype="multipart/form-data">

                        {{csrf_field()}}
                        {{method_field('PUT')}}
                        <div class="form-group">
                            <label for="name">用户名:</label>
                            <input class="form-control" type="text" name="name" id="name" value="{{$user->name}}">
                        </div>


                        <div class="form-group">
                            <label for="email">邮箱:</label>
                            <input class="form-control" type="text" name="email" id="email" value="{{$user->email}}">
                        </div>


                        <div class="form-group">
                            <label for="email">头像:</label>
                            <input class="form-control" type="file" name="image" id="image">
                        </div>

                        <div class="form-group">
                            <label for="email">个人简介:</label>
                            <textarea class="form-control" type="text" name="introduction" id="introduction" rows="2">{{$user->introduction}}</textarea>
                        </div>

                        <div class="form-group">
                            <label for="password">密码:</label>
                            <input class="form-control" type="text" name="password" id="password">
                        </div>

                        <div class="form-group">
                            <label for="password_confirmation">重复密码:</label>
                            <input class="form-control" type="text" name="password_confirmation" id="password">
                        </div>

                        <div class="form-group">
                            <label for="is_admin">管理员:</label>
                            <input class="form-check-label" type="checkbox" checked="{{$user->is_admin === 1}}" value="{{$user->is_admin}}" name="is_admin" id="is_admin" onclick="this.value = this.value == 0 ?1:0">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary" type="submit">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
